package com.xsz.controller;

import com.xsz.entity.User;
import com.xsz.service.UserService;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("url")
public class UrlController {
    @Resource
    UserService userService;


    /**根据当前用户角色修改**/
    @ApiOperation(value = "密码查询")
    @GetMapping("/updaterole")
    public String updaterole(HttpServletRequest req){
        User loginuser=(User)req.getSession().getAttribute("loginuser");
        userService.updateRoleById(loginuser.getId());
        return "redirect:/index.html";
    }
}
